<template>
	<view class="auction-index">
		<!-- 背景图片 -->
		<image class="image-bg" :src="backgroundUrl"></image>
		<!-- 返回按钮 -->
		<view class="advertising">
			<view class="swiper">
				<u-swiper :list="list" autoplay indicator indicatorMode="dot" :interval="4000" circular radius="10"
					indicatorActiveColor="#1D378B" height="50vw"></u-swiper>
			</view>
			<!-- <view class="notice">
				<u-notice-bar :text="notice" bgColor="" color="#9D9D9D"></u-notice-bar>
			</view> -->
		</view>
		<view class="auction">
			<view class="button-group">
				<view :class="`button ${active === 0 ? 'active' : ''}`" @click="changeActive(0)">今日抢购</view>
				<view :class="`button ${active === 1 ? 'active' : ''}`" @click="changeActive(1)">明日预约</view>
			</view>
			<view class="auto-order-button">
				<view class="auto-title-switch">
					<view class="auto-title">机器人抢购</view>
					<view class="auto-button" @click="openAuto">启动</view>
				</view>
				<view class="auto-buy">
					<view class="button" @click="navigateToBuy">启动套餐</view>
				</view>
			</view>
			<view class="auto-order-tips-group">
				<view class="auto-order-tips">机器人生效剩余时间: {{ restTime }}天</view>
				<view class="auto-order-tips-open">{{ isOpen ? '机器人抢购已开启' : '机器人抢购暂未开启' }}</view>
			</view>
			<!-- 今日场次列表 -->
			<view class="auction-content-two" v-if="active === 0" v-for="(res, index) in todayList" :key="index">
				<!-- <view class="index">
					<image class="index-background" src="/static/images/home/poster_index_two.png"></image>
					<view class="index-title">{{ res.catName }}</view>
				</view> -->
				<view class="auction-item">
					<view class="left">
						<image class="img" :src="res.catLogo == '' ? '/static/images/home/git.png' : res.catLogo">
						</image>
						<view class="content-text">
							<view class="time-count-style">
								<view class="time-title">
									<!-- 距本场开始 -->{{ res.catName }}
								</view>
								<!-- 场次信息 -->
								<view class="count-down">
									<!-- {{ todayTimeData.some((item) => {return item.id == res.catId}) }} -->
									<!-- 判断场次是否已经开始 -->
									<!-- <u-count-down :time="res.startTime" format="HH:mm:ss" autoStart millisecond
										@change="onChange">
										<view class="time">
											<view class="time__custom">
												<text
													class="time__custom__item">{{ timeData_0.hours>10?timeData_0.hours:'0'+timeData_0.hours}}</text>
											</view>
											<text class="time__doc">:</text>
											<view class="time__custom">
												<text class="time__custom__item">{{ timeData_0.minutes }}</text>
											</view>
											<text class="time__doc">:</text>
											<view class="time__custom">
												<text class="time__custom__item">{{ timeData_0.seconds }}</text>
											</view>
										</view>
									</u-count-down> -->
									<view class="time" v-if="res.unStart">
										<view class="time__custom">
											<text
												class="time__custom__item">{{ todayTimeData[index].time.hour < 0 ? '00' : todayTimeData[index].time.hour }}</text>
										</view>
										<text class="time__doc">:</text>
										<view class="time__custom">
											<text
												class="time__custom__item">{{ todayTimeData[index].time.minute < 0 ? '00': todayTimeData[index].time.minute }}</text>
										</view>
										<text class="time__doc">:</text>
										<view class="time__custom">
											<text
												class="time__custom__item">{{ todayTimeData[index].time.second < 0 ? '00': todayTimeData[index].time.second }}</text>
										</view>
									</view>
									<view class="time" v-else>
										<view class="time__custom">
											<text class="time__custom__item">00</text>
										</view>
										<text class="time__doc">:</text>
										<view class="time__custom">
											<text class="time__custom__item">00</text>
										</view>
										<text class="time__doc">:</text>
										<view class="time__custom">
											<text class="time__custom__item">00</text>
										</view>
									</view>
								</view>
							</view>
							<view class="date-time">开始时间 {{ res.onlineTime }}</view>
						</view>
					</view>
					<view class="order-button" v-if="res.isOrder === 0 && res.status === 0">
						<!-- @click="addOrder(res.catId, 1, res.creditOne, res.creditTwo)" 立即预约 -->待开始
					</view>
					<view class="order-button-two"
						v-if="res.isOrder === 0 && res.status === 1 || res.isOrder === 1 && res.status === 1"
						@click="checkOrder(res.catId)">
						进入会场
					</view>
					<view class="order-button-one" v-if="res.status === 2" @click="getOrderToast(1)">已结束</view>
					<view class="order-button-three" v-if="res.isOrder === 1 && res.status === 0"
						@click="getOrderToast(2)">已预约</view>
				</view>
			</view>

			<!-- 明日场次列表预约 -->
			<view class="auction-content-two" v-if="active === 1" v-for="(res, index) in tomorrowList" :key="index">
				<!-- <view class="index">
					<image class="index-background" src="/static/images/home/poster_index_two.png"></image>
					<view class="index-title">{{ res.catName }}</view>
				</view> -->
				<view class="auction-item">
					<view class="left">
						<image class="img" :src="res.catLogo == '' ? '/static/images/home/git.png' : res.catLogo">
						</image><!-- /static/images/home/git.png -->
						<view class="content-text">
							<view class="time-count-style">
								<view class="time-title">{{ res.catName }}</view>
								<!-- 场次信息 -->
								<view class="count-down">
									<!-- 判断场次是否已经开始 -->
									<view class="time" v-if="res.unStart">
										<view class="time__custom">
											<text
												class="time__custom__item">{{ tomorrowTimeData[index].time.hour < 0 ? '00' : tomorrowTimeData[index].time.hour }}</text>
										</view>
										<text class="time__doc">:</text>
										<view class="time__custom">
											<text
												class="time__custom__item">{{ tomorrowTimeData[index].time.minute < 0 ? '00': tomorrowTimeData[index].time.minute }}</text>
										</view>
										<text class="time__doc">:</text>
										<view class="time__custom">
											<text
												class="time__custom__item">{{ tomorrowTimeData[index].time.second < 0 ? '00': tomorrowTimeData[index].time.second }}</text>
										</view>
									</view>
									<view class="time" v-else>
										<view class="time__custom">
											<text class="time__custom__item">00</text>
										</view>
										<text class="time__doc">:</text>
										<view class="time__custom">
											<text class="time__custom__item">00</text>
										</view>
										<text class="time__doc">:</text>
										<view class="time__custom">
											<text class="time__custom__item">00</text>
										</view>
									</view>
								</view>
							</view>
							<view class="date-time">开始时间 {{ res.onlineTime }}</view>
						</view>
					</view>
					<view class="order-button" v-if="res.isOrder === 0 && res.status === 0"
						@click="addOrder(res.catId, 2, res.creditOne, res.creditTwo)">
						立即预约
					</view>
					<view class="order-button-two"
						v-if="res.isOrder === 0 && res.status === 1 || res.isOrder === 1 && res.status === 1"
						@click="checkOrder(res.catId)">
						进入会场
					</view>
					<view class="order-button-one" v-if="res.status === 2" @click="getOrderToast(1)">已结束</view>
					<view class="order-button-three" v-if="res.isOrder === 1 && res.status === 0"
						@click="getOrderToast(2)">已预约</view>
				</view>
			</view>
		</view>
		<!-- 弹窗 -->
		<view class="mask" v-if="showTips" @touchmove.stop.prevent>
			<u-transition :show="showTips">
				<view class="modal-bg-box">
					<view class="title">提示</view>
					<view class="inner-box">
						<view class="text-tips" :selectable="false">{{ maskTips }}</view>
						<view class="button-box">
							<view class="button-one" @click="cancel">取消</view>
							<view class="button-two" @click="confirm">确定</view>
						</view>
					</view>
				</view>
			</u-transition>
		</view>
		<!-- 自动预约弹出层 -->
		<u-popup :show="show" :round="10" :closeable="true" @close="close">
			<view class="auto-background">
				<view class="auto-title">{{ order_tips }}</view>
				<!-- <view class="auto-manage">
					<view class="button-style" @click="autoManage">预约抢购管理</view>
				</view> -->
				<view class="button-group">
					<u-checkbox-group v-model="checkboxValue" placement="column" @change="checkboxChange">
						<!-- <view class="content" v-if="autoOrderList.length == 0">
							<view class="null-text">- 暂无预约场次 -</view>
						</view> -->
						<view class="content">
							<!-- v-else -->
							<block v-for="(res, index) in autoOrderList" :key="index">
								<view class="button">
									<view class="left">
										<view class="content-text">
											<view class="date-title">{{ res.catName }}</view>
											<view class="date-tips">
												{{ res.creditOne != '' ? '抢购分不能低于' + res.creditOne : '' }}{{ res.creditTwo != '' ? '且绿色积分不能低于' + res.creditTwo : '' }}
											</view>
										</view>
									</view>
									<view class="right">
										<u-checkbox activeColor="#F64444" :name="res.catId">
										</u-checkbox>
									</view>
								</view>
								<u-gap height="1" bgColor="#CDCDCD"></u-gap>
							</block>
						</view>
					</u-checkbox-group>
				</view>
				<view class="tips-content">
					<view class="tips">提示:</view>
					<view class="tips">机器人抢购开启后将会在当天0点自动预约，预约成功后，将自动冻结抢购分和绿色积分，请确保账户内积分抢购分充足。</view>
				</view>
				<view class="confirm-button" v-if="isAuto === 0" @click="confirmAuto">确定预约抢购</view>
				<view class="confirm-button" v-if="isAuto === 1" @click="cancelAuto">取消预约抢购</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import Fn from '@/common/public.js';
	import {
		banner,
		goodsCatList,
		new_goodsCatList,
		is_appointment,
		appointmentTradFloor,
		AutomaticSubscribeList,
		submit_automaticYUYUE,
		NewGetGoodsList,
		GETuserinfo
	} from '@/common/api.js';
	export default {
		data() {
			return {
				timeData_0: {},

				/* 背景图片 */
				backgroundUrl: '/static/images/auction/new_auction_background.png', // 背景图路径

				/* 返回顶部按钮 */
				scrollTop: 0, // 返回顶部滚动值
				iconStyle: {
					fontSize: '40rpx',
					fontWeight: '600',
					color: '#FFFFFF'
				}, // 滚动内层样式
				custom: {
					background: '#CB8F58'
				}, // 滚动外层样式

				/* 加载更多 */
				loading: {
					status: 'loadmore', // 加载更多设置
					loadingText: '加载中',
					loadmoreText: '轻轻上拉加载更多',
					nomoreText: '暂时没有了',
				}, // 加载设置

				/* 轮播图 */
				list: [], // 轮播图

				/* 公告 */
				notice: '尊敬的用户您好，欢迎来到竞购商城，竞购前请确保有充足的积分', // 滚动公告提示

				/* 套餐时间 */
				restTime: 0, // 套餐剩余时间
				isOpen: false, // 是否已开启自动抢购

				/* 活动信息 */
				todayList: [], // 今日场次内容
				tomorrowList: [], // 明日场次内容
				credit: '', // 预约所需积分
				params: {}, // 预约状态
				autoOrderList: [], // 自动预约列表
				myAutoOrder: [], // 我的自动预约列表

				/* 选择按钮 */
				active: 0, // 场次选择按钮
				button_text: '立即预约', // 预约按钮

				/* 倒计时 */
				nowTime: '', // 当前时间戳
				timeData: [],
				hour: '',
				minute: '',
				second: '',
				todayTimeData: [{
					time: {
						hour: -1,
						minute: -1,
						second: -1
					},
					// isStart: false
				}], // 今日场次倒计时数组
				tomorrowTimeData: [], // 明日场次倒计时数组
				choiceTodayList: [], // 今日场次时间判断
				choiceTomorrowList: [], // 明日场次时间判断
				timeData_one: {},
				timeData_two: {},
				timeData_three: {},
				timeData_four: {},
				timeData_five: {},
				timeData_six: {},
				timeData_seven: {},
				timeData_eight: {},
				setTime: '',

				/* 弹窗 */
				maskTips: '', // 弹窗提示
				showTips: false, // 弹窗状态

				/* 弹出自动预约窗口 */
				show: false, // false
				value: '',
				checkboxValue: [],
				isSelect: [],
				isAuto: 0, // 默认确定预约
				order_tips: '请选择您要预约的场次', // 预约提示
				orderList: [], // 预约场次ID
				autoParams: '', // 预约参数

				/* switch选择 */
				default_switch: false, // 是否设置默认
				disable: false, // 默认能选择
			};
		},
		mounted() {

		},
		onLoad() {
			this.getBanner(); // 获取轮播图内容
			// this.refreAuction().then(() => { // 主动请求定时任务
			// 	// this.getAuction();
			// }); // 刷新状态
		},
		onShow() {
			this.getUser(); // 获取用户数据
			/* 默认选择今日 */
			this.active = 0;
			/* 获取活动场次内容 */
			this.getAuction();
		},
		/* 返回顶部 */
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
		},
		onHide() {
			clearTimeout(this.setTime);
		},
		/* 切换页面清除定时器 */
		onUnload() {
			clearTimeout(this.setTime);
		},
		/* 下拉刷新 */
		onPullDownRefresh() {
			const that = this;
			that.regetAuction(); // 刷新页面
			// clearTimeout(that.setTime);
			setTimeout(() => {
				uni.stopPullDownRefresh(); // 结束刷新页面
			}, 1000);
		},
		methods: {

			onChange(e) {
				this.timeData_0 = e
				console.log(e)
			},

			/* 刷新状态 */
			refreAuction() {
				return new Promise(function(resolve, reject) {
					uni.request({
						url: 'http://ows.jiushuntang.cn/api/Task/up_goods',
						header: {
							'Content-Type': 'application/json; charset=UTF-8'
						},
						success: (res) => {
							console.log(res.data);
						}
					});
					resolve();
				});
			},

			/* 获取轮播图内容 */
			getBanner() {
				const that = this;
				banner().then((res) => {
					if (res.status === 1) {
						const result = res.data;
						for (let i = 0; i < result.length; i++) {
							that.list.push(result[i].url);
						};
					} else {
						Fn.Toast(res.msg, 3, 1500);
					};
				});
			},

			/* 获取剩余天数 */
			getUser() {
				const that = this;
				GETuserinfo().then((res) => {
					if (res.status === 1) {
						const result = res.data;
						that.restTime = result.expired_day;
						that.isOpen = result.ty_area === 0 ? false : true;
					}
				});
			},

			/* 获取活动列表内容 */
			async getAuction() {
				const that = this;
				that.isSelect = [];
				that.checkboxValue = [];
				const params = {
					type: 1
				};
				let nowTime = that.getNowTime(); // 获取当前系统时间
				await NewGetGoodsList(params).then((res) => {
					if (res.status === 1) {
						const result = res.data;
						// that.credit = result.yuyue_eeputation;
						// console.log(result);
						that.todayList = result.today.map(item => {
							return {
								startTime: parseInt(item.startTime + '000'),
								endTime: parseInt(item.endTime + '000'),
								onlineTime: item.onlineTime,
								// parentId: item.parentId,
								// parentName: item.parentName,
								isOrder: item.is_yuyue,
								// list: item.list,
								catId: item.catId,
								catName: item.catName,
								catLogo: item.catLogo,
								status: item.status,
								statusName: item.statusName,
								creditOne: item.dj_balance, // 抢购分
								creditTwo: item.dj_lvintegral, // 绿色积分
								unStart: nowTime < parseInt(item.startTime + '000') ? true : nowTime >
									parseInt(item.startTime + '000') ? false : true
							};
						});
						that.choiceTodayList = result.today.map(item => {
							return {
								startTime: parseInt(item.startTime + '000'),
								endTime: parseInt(item.endTime + '000'),
								catId: item.catId,
								unStart: nowTime < parseInt(item.startTime + '000') ? true : nowTime >
									parseInt(item.startTime + '000') ? false : true
							};
						}); // 今日时间列表
						that.tomorrowList = result.tomorrow.map(item => {
							return {
								startTime: parseInt(item.startTime + '000'),
								endTime: parseInt(item.endTime + '000'),
								onlineTime: item.onlineTime,
								// parentId: item.parentId,
								// parentName: item.parentName,
								isOrder: item.is_yuyue,
								// list: item.list,
								catId: item.catId,
								catName: item.catName,
								catLogo: item.catLogo,
								status: item.status,
								statusName: item.statusName,
								creditOne: item.dj_balance, // 抢购分
								creditTwo: item.dj_lvintegral, // 绿色积分
								unStart: nowTime < parseInt(item.startTime + '000') ? true : nowTime >
									parseInt(item.startTime + '000') ? false : true
							};
						});
						that.choiceTomorrowList = result.tomorrow.map(item => {
							return {
								startTime: parseInt(item.startTime + '000'),
								endTime: parseInt(item.endTime + '000'),
								catId: item.catId,
								unStart: nowTime < parseInt(item.startTime + '000') ? true : nowTime >
									parseInt(item.startTime + '000') ? false : true
							};
						}); // 明日时间列表
						if (that.active === 0) {
							that.todayListCount(); // 设置定时器倒计时
						} else {
							that.tomorrowListCount();
						};
					} else {
						Fn.Toast(res.msg, 3, 1500);
					};
				});
				// await new_goodsCatList().then((res) => {
				// 	if (res.status === 1) {
				// 		const result = res.data;
				// 		// console.log(result);
				// 		that.credit = result.yuyue_eeputation;
				// 		that.todayList = result.today.map(item => {
				// 			return {
				// 				startTime: parseInt(item.startTime + '000'),
				// 				endTime: parseInt(item.endTime + '000'),
				// 				onlineTime: item.onlineTime,
				// 				parentId: item.parentId,
				// 				parentName: item.parentName,
				// 				isOrder: item.is_yuyue,
				// 				list: item.list,
				// 				creditOne: item.dj_balance, // 抢购分
				// 				creditTwo: item.dj_lvintegral, // 绿色积分
				// 			};
				// 		});
				// 		that.tomorrowList = result.tomorrow.map(item => {
				// 			return {
				// 				startTime: parseInt(item.startTime + '000'),
				// 				endTime: parseInt(item.endTime + '000'),
				// 				onlineTime: item.onlineTime,
				// 				parentId: item.parentId,
				// 				parentName: item.parentName,
				// 				isOrder: item.is_yuyue,
				// 				list: item.list,
				// 				creditOne: item.dj_balance, // 抢购分
				// 				creditTwo: item.dj_lvintegral, // 绿色积分
				// 			};
				// 		});
				// 		// console.log(that.todayList);
				// 	} else {
				// 		Fn.Toast(res.msg, 3, 1500);
				// 	};
				// });
			},

			/* 重新获取场次数据 */
			regetAuction() {
				const that = this;
				const params = {
					type: 1
				};
				// that.refreAuction().then(() => {
				// setTimeout(() => {
				let nowTime = that.getNowTime(); // 获取当前系统时间
				NewGetGoodsList(params).then((res) => {
					if (res.status === 1) {
						const result = res.data;
						that.credit = result.yuyue_eeputation;
						that.todayList = result.today.map(item => {
							return {
								startTime: parseInt(item.startTime + '000'),
								endTime: parseInt(item.endTime + '000'),
								onlineTime: item.onlineTime,
								// parentId: item.parentId,
								// parentName: item.parentName,
								isOrder: item.is_yuyue,
								// list: item.list,
								catId: item.catId,
								catName: item.catName,
								catLogo: item.catLogo,
								status: item.status,
								statusName: item.statusName,
								creditOne: item.dj_balance, // 抢购分
								creditTwo: item.dj_lvintegral, // 绿色积分
								unStart: nowTime < parseInt(item.startTime + '000') ? true : nowTime >
									parseInt(item.startTime + '000') ? false : true
							};
						});
						that.tomorrowList = result.tomorrow.map(item => {
							return {
								startTime: parseInt(item.startTime + '000'),
								endTime: parseInt(item.endTime + '000'),
								onlineTime: item.onlineTime,
								// parentId: item.parentId,
								// parentName: item.parentName,
								isOrder: item.is_yuyue,
								// list: item.list,
								catId: item.catId,
								catName: item.catName,
								catLogo: item.catLogo,
								status: item.status,
								statusName: item.statusName,
								creditOne: item.dj_balance, // 抢购分
								creditTwo: item.dj_lvintegral, // 绿色积分
								unStart: nowTime < parseInt(item.startTime + '000') ? true : nowTime >
									parseInt(item.startTime + '000') ? false : true
							};
						});
						that.choiceTodayList = result.today.map(item => {
							return {
								startTime: parseInt(item.startTime + '000'),
								endTime: parseInt(item.endTime + '000'),
								catId: item.catId,
								unStart: nowTime < parseInt(item.startTime + '000') ? true : nowTime >
									parseInt(item.startTime + '000') ? false : true
							};
						}); // 今日时间列表
						that.choiceTomorrowList = result.tomorrow.map(item => {
							return {
								startTime: parseInt(item.startTime + '000'),
								endTime: parseInt(item.endTime + '000'),
								catId: item.catId,
								unStart: nowTime < parseInt(item.startTime + '000') ? true : nowTime >
									parseInt(item.startTime + '000') ? false : true
							};
						}); // 明日时间列表
						that.$set(that, "todayList", that.todayList); // 更新页面，重新赋值
						that.$set(that, "tomorrowList", that.tomorrowList); // 更新页面，重新赋值
					} else {
						Fn.Toast(res.msg, 3, 1500);
					};
				});
				// }, 300);
				// });
			},

			/* 今日场次倒计时 */
			todayListCount() {
				const that = this;
				// let length = that.todayList.length; // 获取场次数量
				// let now = that.getNowTime(); // 获取当前系统时间
				// // let totalList = []; // 存放全部场次
				// let unStartList = []; // 存放还没开始场次
				// let endList = []; // 存放已开始场次
				// for (let i = 0; i < length; i++) { // 循环1次判断哪个场次还未到开始时间
				// 	// let data = {
				// 	// 	id: that.todayList[i].catId,
				// 	// 	startTime: that.todayList[i].startTime
				// 	// };
				// 	if (now < that.todayList[i].startTime) { // 判断还未开始场次
				// 		let params = {
				// 			id: that.todayList[i].catId,
				// 			startTime: that.todayList[i].startTime
				// 		};
				// 		unStartList.push(params); // 存储还未开始场次时间戳
				// 		// data.start = true; // 添加未开始标识
				// 	} else if (now > that.todayList[i].startTime) {
				// 		let params = {
				// 			id: that.todayList[i].catId,
				// 			startTime: that.todayList[i].startTime
				// 		};
				// 		endList.push(params); // 存储已结束场次时间戳
				// 		// data.start = false; // 添加结束标识
				// 	};
				// 	// totalList.push(data);
				// };
				// // that.choiceTodayList = totalList; // 今日场次时间判断

				that.setCountStart(that.choiceTodayList);

				// that.setCountStart(unStartList); // 设置倒计时
				// that.setEndStart(endList); // 设置结束时间
			},

			/* 明日场次倒计时 */
			tomorrowListCount() {
				const that = this;
				// let length = that.tomorrowList.length; // 获取场次数量
				// let now = that.getNowTime(); // 获取当前系统时间
				// // let totalList = []; // 存放全部场次
				// let unStartList = []; // 存放还没开始场次
				// let endList = []; // 存放已开始场次
				// for (let i = 0; i < length; i++) { // 循环1次判断哪个场次还未到开始时间
				// 	// let data = {
				// 	// 	id: that.tomorrowList[i].catId,
				// 	// 	startTime: that.tomorrowList[i].startTime
				// 	// };
				// 	if (now < that.tomorrowList[i].startTime) { // 判断还未开始场次
				// 		let params = {
				// 			index: i,
				// 			startTime: that.tomorrowList[i].startTime
				// 		};
				// 		unStartList.push(params); // 存储还未开始场次时间戳
				// 		// data.start = true; // 添加未开始标识
				// 	} else if (now > that.todayList[i].startTime) {
				// 		let params = {
				// 			index: i,
				// 			startTime: that.todayList[i].startTime
				// 		};
				// 		endList.push(params); // 存储还未开始场次时间戳
				// 		// data.start = false; // 添加结束标识
				// 	};
				// };
				// // that.choiceTomorrowList = totalList; // 明日场次时间判断

				that.setCountStart(that.choiceTomorrowList);

				// that.setCountStart(unStartList); // 设置倒计时
				// that.setEndStart(endList); // 设置结束时间
			},

			/* 切换场次 */
			changeActive(id) {
				clearTimeout(this.setTime);
				if (id === 0) {
					this.active = 0;
					this.todayListCount();
				} else {
					this.active = 1;
					this.tomorrowListCount();
				};
			},

			/* 获取当前时间戳 */
			getNowTime() {
				let timestamp = new Date().getTime(); // 获取当前时间时间戳
				// this.nowTime = timestamp;
				return timestamp; // 返回当前时间戳
			},

			/* 计算开始时间 */
			countStart(startTime) {
				let now = this.getNowTime(); // 获取当前时间
				let time = startTime - now;
				let leftd = Math.floor(time / (1000 * 60 * 60 * 24)), //计算天数
					lefth = Math.floor(time / (1000 * 60 * 60) % 48), //计算小时数
					leftm = Math.floor(time / (1000 * 60) % 60), //计算分钟数
					lefts = Math.floor(time / 1000 % 60); //计算秒数
				if (lefth >= 0 && leftm >= 0 && lefts >= 0) {
					return {
						hour: lefth,
						minute: leftm,
						second: lefts
					};
				} else {
					return {
						hour: -1,
						minute: -1,
						second: -1
					};
				};
			},

			setCountStart(list) {
				const that = this;
				/* 每一秒执行一次自己 */
				that.setTime = setTimeout(() => {
					that.setCountStart(list);
				}, 1000);
				// 全部场次已经开始
				const check = {
					time: {
						hour: -1,
						minute: -1,
						second: -1
					},
					isStart: true
				};

				if (that.active === 0) { // 今日场次

					if ( /* list.length === 0 */ that.todayTimeData.every((item) => {
							return JSON.stringify(item) === JSON.stringify(check)
						})) {
						clearTimeout(that.setTime);
						// 重置时间 没有未开始时间全部重置
						// if (that.active === 0) {
						// 	that.todayTimeData = []; // 今日预约重置
						// 	// that.timeData_one = {};
						// 	// that.timeData_two = {};
						// 	// that.timeData_three = {};
						// 	// that.timeData_seven = {};
						// } else {
						// 	that.tomorrowTimeData = []; // 明日预约重置
						// };
					} else { // 有场次未开始
						/* 循环判断是否有倒计时数据 有就赋值 没有就清除数值 */
						let countList = [];

						for (let i = 0; i < list.length; i++) {

							/* 动态 */
							let data = {
								// id: list[i].catId,
								// time: that.countStart(list[i].startTime),
								isStart: false
							};
							data.id = list[i].catId;
							data.time = that.countStart(list[i].startTime);
							/* 非动态 */
							// if (list[i].index === 0) {
							// 	that.timeData_one = that.countStart(list[i].startTime);
							// } else if (list[i].index === 1) {
							// 	that.timeData_two = that.countStart(list[i].startTime);
							// } else if (list[i].index === 2) {
							// 	that.timeData_three = that.countStart(list[i].startTime);
							// } else if (list[i].index === 3) {
							// 	that.timeData_seven = that.countStart(list[i].startTime);
							// };

							// if (!list[i].unStart) {
							// 	list.splice(i, 1); // 场次开始后清除数据，避免重复请求
							// }

							/* 已经开始场次 重置时间 */
							if (data.time.hour == -1 && data.time.minute == -1 && data.time.second == -1) {
								if (list[i].unStart) {
									that.regetAuction(); // 场次开始请求接口，改变状态
									list[i].unStart = false;
								}
								// list.splice(i, 1); // 场次开始后清除数据，避免重复请求
								data.isStart = true;
							}

							// if (that.countStart(list[i].startTime).hour == -1 && that.countStart(list[i].startTime)
							// 	.minute == -
							// 	1 && that.countStart(list[i].startTime).second == -1) {
							// 	that.regetAuction(); // 场次开始请求接口，改变状态
							// 	list.splice(i, 1); // 场次开始后清除数据，避免重复请求
							// 	console.log(1)
							// 	// if (list[i].index === 0) {
							// 	// 	that.timeData_one = {};
							// 	// } else if (list[i].index === 1) {
							// 	// 	that.timeData_two = {};
							// 	// } else if (list[i].index === 2) {
							// 	// 	that.timeData_three = {};
							// 	// } else if (list[i].index === 3) {
							// 	// 	that.timeData_seven = {};
							// 	// };
							// };
							countList.push(data);
						};
						that.todayTimeData = countList;
						// console.log(that.todayTimeData);
					}
				} else {
					/* 循环判断是否有倒计时数据 有就赋值 没有就清除数值 */
					let countList = [];
					for (let i = 0; i < list.length; i++) {

						/* 动态 */
						const data = {
							id: list[i].catId,
							time: that.countStart(list[i].startTime)
						};

						// if (!list[i].unStart) {
						// 	list.splice(i, 1); // 场次开始后清除数据，避免重复请求
						// }

						/* 已经开始场次 重置时间 */
						// if (data.time.hour == -1 && data.time.minute == -1 && data.time.second == -1) {
						// 	// that.regetAuction(); // 场次开始请求接口，改变状态
						// 	list.splice(i, 1); // 场次开始后清除数据，避免重复请求
						// 	// data.isStart = true;
						// }

						/* 非动态 */
						// if (list[i].index === 0) {
						// 	that.timeData_four = that.countStart(list[i].startTime);
						// } else if (list[i].index === 1) {
						// 	that.timeData_five = that.countStart(list[i].startTime);
						// } else if (list[i].index === 2) {
						// 	that.timeData_six = that.countStart(list[i].startTime);
						// } else if (list[i].index === 3) {
						// 	that.timeData_eight = that.countStart(list[i].startTime);
						// } else {
						// 	that.timeData_four = {};
						// 	that.timeData_five = {};
						// 	that.timeData_six = {};
						// 	that.timeData_eight = {};
						// };

						// /* 已经开始场次 重置时间 */
						// if (that.countStart(list[i].startTime).hour == -1 && that.countStart(list[i].startTime)
						// 	.minute == -
						// 	1 && that.countStart(list[i].startTime).second == -1) {
						// 	that.regetAuction(); // 场次开始请求接口，改变状态
						// 	list.splice(i, 1); // 场次开始后清除数据，避免重复请求
						// 	countList.push(data);

						// 	// if (list[i].index === 0) {
						// 	// 	that.timeData_four = {};
						// 	// } else if (list[i].index === 1) {
						// 	// 	that.timeData_five = {};
						// 	// } else if (list[i].index === 2) {
						// 	// 	that.timeData_six = {};
						// 	// } else if (list[i].index === 3) {
						// 	// 	that.timeData_eight = {};
						// 	// };
						// } else {
						// 	countList.push(data);
						// };
						countList.push(data);
					};
					that.tomorrowTimeData = countList;
				};
			},

			/* 设置已开始时间 防止时间卡 */
			setEndStart(list) {
				const that = this;
				if (list.length != 0) {
					// 今日预约
					if (that.active === 0) {
						// for (let i = 0; i < list.length; i++) {
						// 	if (list[i].index === 0) {
						// 		that.timeData_one = {};
						// 	} else if (list[i].index === 1) {
						// 		that.timeData_two = {};
						// 	} else if (list[i].index === 2) {
						// 		that.timeData_three = {};
						// 	} else if (list[i].index === 3) {
						// 		that.timeData_seven = {};
						// 	};
						// };
					} else { // 明日预约
						// for (let i = 0; i < list.length; i++) {
						// 	if (list[i].index === 0) {
						// 		that.timeData_four = {};
						// 	} else if (list[i].index === 1) {
						// 		that.timeData_five = {};
						// 	} else if (list[i].index === 2) {
						// 		that.timeData_six = {};
						// 	} else if (list[i].index === 3) {
						// 		that.timeData_eight = {};
						// 	};
						// };
					};
				};
			},

			/* 立即预约 */
			addOrder(parentID, id, creditOne, creditTwo) {
				const that = this;
				const params_two = {
					type: id,
					parentId: parentID
				};
				that.params = params_two;
				that.showTips = true;
				if (creditOne != '' && creditTwo != '') {
					that.maskTips = '确定冻结' + creditOne + '抢购分和' + creditTwo + '绿色积分预约本场活动？'
				} else if (creditOne != '' && creditTwo == '') {
					that.maskTips = '确定冻结' + creditOne + '抢购分预约本场活动？'
				} else {
					that.maskTips = '确定冻结' + creditTwo + '绿色积分预约本场活动？'
				}
			},

			/* 检查是否有预约 */
			checkOrder(auctionID /* , time */ ) {
				const that = this;
				const params = {
					parentId: auctionID
				};
				is_appointment(params).then((res) => {
					if (res.status === 1) {
						const result = res.data;
						if (result.is_yy === 0) {
							Fn.Toast('您尚未预约本场竞购，请先下次预约后进行竞购', 3, 1500);
							return;
						}
						if (result.is_yy === 1 && result.is_rush === 0) {
							this.navigateAction(auctionID /* , time */ );
						} else {
							Fn.Toast('您已参与本场活动，请参加下轮活动', 3, 1500);
							return;
						};
					} else {
						Fn.Toast(res.msg, 3, 1500);
					};
				});
			},

			/* 活动结束提示 */
			getOrderToast(option) {
				if (option === 1) {
					Fn.Toast('活动已结束，请期待下次参与', 3, 1500);
				} else {
					Fn.Toast('活动已预约', 3, 1500);
				};
			},

			/* 确认 */
			confirm() {
				// 节流操作防止重复请求
				uni.$u.throttle(() => {
					appointmentTradFloor(this.params).then((res) => {
						if (res.status === 1) {
							const result = res.data;
							Fn.Toast(res.msg, 3, 1500);
							this.regetAuction();
						} else {
							Fn.Toast(res.msg, 3, 1500);
						};
					});
				}, 1500);
				this.showTips = false;
			},

			/* 取消 */
			cancel() {
				this.showTips = false;
			},

			/* 打开弹出窗口 */
			openAuto() {
				const that = this;
				that.show = true;
				that.isSelect = [];
				that.checkboxValue = [];
				that.orderList = [];
				const params = {
					type: 1
				}
				AutomaticSubscribeList(params).then((res) => {
					if (res.status === 1) {
						const result = res.data;
						that.autoOrderList = result.map(item => {
							return {
								catId: item.catId,
								catName: item.catName,
								check: item.is_yuyue === 0 ? false : true,
								creditOne: item.dj_balance,
								creditTwo: item.dj_lvintegral
							};
						});
						for (let i = 0; i < that.autoOrderList.length; i++) {
							if (that.autoOrderList[i].check) {
								that.checkboxValue.push(that.autoOrderList[i].catId);
							};
							that.orderList.push(that.autoOrderList[i].catId);
						};
					} else {
						Fn.Toast(res.msg, 3, 1500);
					};
				});
			},

			/* 关闭弹出窗口 */
			close() {
				this.show = false
			},

			/* 是否设置为默认 */
			changeDefault(e) {
				if (e === true) {
					this.default_switch = true;
					Fn.Toast('自动预约已开启', 3, 1500);
				} else {
					this.default_switch = false;
					Fn.Toast('自动预约已关闭', 3, 1500);
				};
			},

			/* 复选框设置 */
			checkboxChange(n) {
				const that = this;
				// that.autoParams = 
				that.checkboxValue = n;
				// console.log(Fn.compareArray(that.orderList, that.checkboxValue))
				// console.log(that.checkboxValue);
				// console.log(that.orderList.indexOf(that.checkboxValue[0]))
			},

			/* 自动预约确定按钮 */
			confirmAuto() {
				const that = this;
				let params = {
					activity_arr: []
				};

				// if (that.checkboxValue.length === 0) {
				// 	Fn.Toast('请选择预约的场次', 3, 1500);
				// 	return;
				// };

				// 1 - 取消 | 2 - 开启
				for (let i = 0; i < that.orderList.length; i++) {
					let item = {};
					if (that.checkboxValue.includes(that.orderList[i])) {
						item = {
							catId: that.orderList[i],
							issta: 2
						};
					} else {
						item = {
							catId: that.orderList[i],
							issta: 1
						};
					}
					params.activity_arr.push(item);
				};

				// 节流操作防止重复请求
				uni.$u.throttle(() => {
					submit_automaticYUYUE(params).then((res) => {
						if (res.status === 1) {
							// console.log(res);
							Fn.Toast(res.msg, 3, 1500);
							that.show = false;
							that.getUser(); // 获取是否开启机器人预约
						} else {
							Fn.Toast(res.msg, 3, 1500);
						};
					});
					// console.log(params)
				}, 1000);
			},

			/* 取消自动预约 */
			cancelAuto() {
				const that = this;
				let params = {
					activity_arr: []
				};
				// if (that.checkboxValue.length === 0) {
				// 	Fn.Toast('请选择取消预约的场次', 3, 1500);
				// 	return;
				// };
				for (let i = 0; i < that.checkboxValue.length; i++) {
					const item = {
						catId: that.checkboxValue[i],
						issta: 1
					};
					params.activity_arr.push(item);
				};
				submit_automaticYUYUE(params).then((res) => {
					if (res.status === 1) {
						Fn.Toast(res.msg, 3, 1500);
						that.show = false;
					} else {
						Fn.Toast(res.msg, 3, 1500);
					};
				});
			},

			/* 管理自动预约 */
			autoManage() {
				const that = this;
				const params = {
					type: 1
				}
				if (that.isAuto === 0) {
					that.isAuto = 1;
					that.checkboxValue = [];
					that.autoOrderList = [];
					that.order_tips = '请选择您要取消预约的场次';
					let newList = [];
					AutomaticSubscribeList(params).then((res) => {
						if (res.status === 1) {
							const result = res.data;
							// console.log(result);
							that.autoOrderList = result.map(item => {
								return {
									catId: item.catId,
									catName: item.catName,
									check: item.is_yuyue === 0 ? false : true,
									creditOne: item.dj_balance,
									creditTwo: item.dj_lvintegral
								};
							});
							// console.log(that.autoOrderList)
							for (let i = 0; i < that.autoOrderList.length; i++) {
								if (that.autoOrderList[i].check) {
									newList.push(that.autoOrderList[i]);
								};
							};
							that.autoOrderList = newList;
							// console.log(that.autoOrderList)
						} else {
							Fn.Toast(res.msg, 3, 1500);
						};
					});
				} else {
					that.isAuto = 0;
					that.checkboxValue = [];
					that.autoOrderList = [];
					that.order_tips = '请选择您要预约的场次';
					AutomaticSubscribeList(params).then((res) => {
						if (res.status === 1) {
							const result = res.data;
							that.autoOrderList = result.map(item => {
								return {
									catId: item.catId,
									catName: item.catName,
									check: item.is_yuyue === 0 ? false : true,
									creditOne: item.dj_balance,
									creditTwo: item.dj_lvintegral
								};
							});
							for (let i = 0; i < that.autoOrderList.length; i++) {
								if (that.autoOrderList[i].check) {
									that.checkboxValue.push(that.autoOrderList[i].catId);
								};
							};
						} else {
							Fn.Toast(res.msg, 3, 1500);
						};
					});
				};
			},

			/* 跳转至邀请海报页面 */
			navigatePoster() {
				uni.navigateTo({
					url: '/pages/index/invite/invite',
				});
			},

			/* 跳转至活动页面 */
			navigateAction(option, time) {
				uni.navigateTo({
					url: '/pages/index/action/action?id=' + option /* + '&time=' + time */ ,
				});
			},

			navigateNotice(option) {
				uni.navigateTo({
					url: '/pages/notice/noticeDetail/noticeDetail?id=' + option + '&mode=' + 1,
				});
			},

			/* 跳转至购买套餐页面 */
			navigateToBuy() {
				uni.navigateTo({
					url: '/pages/auction/orderMenu/orderMenu'
				})
			}
		}
	}
</script>

<style lang="scss">
	// @import "@/static/css/auction.scss";

	.time {
		@include flex;
		align-items: center;

		&__custom {
			// margin-top: 4px;
			width: 24px;
			height: 24px;
			background-color: #EB4A4A;
			border-radius: 4px;
			/* #ifndef APP-NVUE */
			display: flex;
			/* #endif */
			justify-content: center;
			align-items: center;

			&__item {
				color: #fff;
				font-size: 16px;
				text-align: center;
			}
		}

		&__doc {
			color: #EB4A4A;
			padding: 0px 4px;
		}

		&__item {
			color: #606266;
			font-size: 15px;
			margin-right: 4px;
		}
	}

	.mask {
		position: fixed;
		z-index: 1001;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		background-color: rgba(0, 0, 0, 0.5);

		.modal-bg-box {
			background-color: #FFFFFF;
			width: 580rpx;
			// height: 390rpx;
			position: absolute;
			left: 50%;
			top: 45%;
			transform: translate(-50%, -50%);

			.title {
				text-align: center;
				margin: 40rpx 0;
				font-size: 42rpx;
				// font-weight: 600;
				font-family: PingFang_Bold;
			}

			.inner-box {
				margin: 20rpx 55rpx 40rpx 55rpx;
				text-align: center;

				.text-tips {
					display: block;
					line-height: 70rpx;
					font-size: 33rpx;
					// font-family: Alibaba PuHuiTi;
					// font-weight: bold;
					color: #89898C;
					word-wrap: break-word;
					font-family: PingFang_Bold;
				}

				.button-box {
					text-align: center;
					margin-top: 50rpx;
					display: flex;
					align-items: center;
					justify-content: center;

					.button-one {
						display: inline-block;
						padding: 0 10px;
						width: 120rpx;
						height: 58rpx;
						line-height: 58rpx;
						margin: 0 40rpx 0 0;
						text-align: center;
						color: #000000;
						border: 2px solid #000000;
						border-radius: 8rpx;
						font-size: 26rpx;
						// font-weight: bold;
						// cursor: pointer;
						font-family: PingFang_Bold;
					}

					.button-two {
						padding: 0 10px;
						background-color: #000000;
						display: inline-block;
						width: 120rpx;
						height: 58rpx;
						line-height: 58rpx;
						// margin: 0 0 0 40rpx;
						text-align: center;
						color: #FFFFFF;
						border-radius: 8rpx;
						font-size: 26rpx;
						// font-weight: bold;
						// cursor: pointer;
						font-family: PingFang_Bold;
					}
				}
			}
		}
	}

	.auction-index {
		// background-color: #F5F5F5;
		font-family: PingFang_Medium;

		// 背景图片
		.image-bg {
			position: fixed;
			width: 100%;
			height: 100%;
			left: 0;
			right: 0;
			bottom: 0;
			z-index: -1;
		}

		.advertising {
			// background-color: #FFFFFF;
			padding: 10px 18px 20px 18px;

			.swiper {}

			.notice {
				margin: 10px 0;
			}

			.tips {
				background-image: linear-gradient(to right, #FCEBD9, #FAD1AE);
				padding: 12px 10px 12px 20px;
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-radius: 10px;
				color: #CB8F58;

				.left-content {
					display: flex;
					align-items: center;

					.left-image {
						width: 9vw;
						height: 48rpx;
					}

					.left-detail {
						margin-left: 13px;
						font-size: 3.8vw;
						font-weight: 600;
					}
				}

				.right-content {
					display: flex;
					align-items: center;
					cursor: pointer;

					.right-image {
						width: 1.5vw;
						height: auto;
					}

					.right-detail {
						margin-right: 10px;
						font-size: 2.8vw;
					}
				}
			}
		}

		.auction {
			position: relative;
			margin-top: 10px;
			// background-color: #FFFFFF;
			padding: 15px 12px 15px 12px;

			.auction-title {
				padding: 10px;
				text-align: center;
				margin-bottom: 2vh;
				font-size: 36rpx;
				font-weight: 600;
				background-image: linear-gradient(to right, #FAD1AE, #FCEBD9);
				border-radius: 5px;
			}

			.auto-order-tips-group {
				display: flex;
				align-items: center;
				justify-content: space-between;
				
				.auto-order-tips {
					font-size: 28rpx;
				}
				
				.auto-order-tips-open {
					font-size: 28rpx;
					font-family: PingFang_Bold;
				}
			}

			.acution-content {
				position: relative;
				box-sizing: border-box;
				margin-bottom: 18px;
				// top: 10px;
				height: 58vw;
				// cursor: pointer;

				.auction-background {
					position: absolute;
					width: 100%;
					height: 100%;
					border-radius: 20px;
					z-index: 0;
				}

				// background-image: url('~@/static/home/poster_demo.png');
				// background-repeat: no-repeat;
				// background-size: 100% 100%;

				.index {
					position: absolute;
					z-index: 1;
					right: 0;
					width: 18vw;
					height: 8vw;

					.index-background {
						position: absolute;
						right: 0;
						width: 18vw;
						height: 100%;
					}

					.index-title {
						position: relative;
						top: 50%;
						transform: translateY(-55%);
						z-index: inherit;
						color: #FFFFFF;
						font-size: 40rpx;
						text-align: center;
					}
				}

				.time {
					width: 80%;
					margin: 0 auto;
					padding: 3px 20px;
					position: absolute;
					z-index: 1;
					left: 0;
					right: 0;
					bottom: 5px;
					background-color: rgba(255, 255, 255, 0.5);
					box-shadow: 0px 0px 10px 2px #FFFFFF;
					text-align: center;
					border-radius: 10px;

					.time-detail {
						font-size: 3.8vw;
						// font-weight: 600;
					}
				}
			}

			.button-group {
				display: flex;
				align-items: center;
				justify-content: center;

				.button {
					width: 23vw;
					line-height: 58rpx;
					text-align: center;
					font-size: 30rpx;
					// font-weight: 600;
					color: #a6a6a6;
					font-family: PingFang_Bold;
					// cursor: pointer;

					&:nth-of-type(1) {
						margin-right: 10rpx;
					}

					&:nth-of-type(2) {
						margin-left: 10rpx;
					}
				}

				.active {
					background-color: #F64444;
					color: #FFFFFF;
					border-radius: 8rpx;
				}
			}

			.auction-content-two {
				margin: 40rpx 0;

				.index {
					position: absolute;
					z-index: 1;
					right: 12px;
					width: 18vw;
					height: 50rpx;

					.index-background {
						position: absolute;
						right: 0;
						width: 18vw;
						height: 100%;
					}

					.index-title {
						position: relative;
						top: 50%;
						transform: translateY(-55%);
						z-index: inherit;
						color: #F64444;
						font-size: 14px;
						text-align: center;
						line-height: 50rpx;
					}
				}

				.auction-item {
					padding: 55rpx 25rpx;
					box-sizing: border-box;
					box-shadow: 0px 2px 5px #dedede;
					display: flex;
					align-items: center;
					justify-content: space-between;
					background-color: rgba(274, 90, 87, 0.2);
					border-radius: 10rpx;

					.left {
						display: flex;
						align-items: center;

						.img {
							width: 12vw;
							height: 12vw;
							border-radius: 8px;
						}

						.content-text {
							margin-left: 20rpx;

							.time-count-style {
								display: flex;
								align-items: center;

								.time-title {
									font-size: 30rpx;
									font-family: PingFang_Bold;
									// font-weight: 600;
								}

								.count-down {
									margin-left: 20rpx;
								}
							}

							.date-time {
								margin-top: 10rpx;
								// color: #a6a6a6;
								// color: #FFFFFF;
								font-size: 26rpx;
							}
						}
					}

					.order-button {
						width: 15vw;
						text-align: center;
						background-color: #FFE0BB;
						padding: 6px 10px;
						font-size: 26rpx;
						border-radius: 5px;
						// cursor: pointer;
					}

					.order-button-one {
						width: 15vw;
						text-align: center;
						background-color: #F5F5F5;
						padding: 6px 10px;
						font-size: 26rpx;
						border-radius: 5px;
						// cursor: pointer;
					}

					.order-button-two {
						width: 15vw;
						text-align: center;
						color: #FFFFFF;
						background-color: #5388F7;
						padding: 6px 10px;
						font-size: 26rpx;
						border-radius: 5px;
						// cursor: pointer;
					}

					.order-button-three {
						width: 15vw;
						text-align: center;
						color: #FFFFFF;
						background-color: #049C44;
						padding: 6px 10px;
						font-size: 26rpx;
						border-radius: 5px;
						// cursor: pointer;
					}
				}
			}
		}

		.auto-order-button {
			margin: 40rpx 0;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.auto-title-switch {
				display: flex;
				align-items: center;
				padding: 20rpx 30rpx;
				box-sizing: border-box;
				box-shadow: 0px 2px 5px #dedede;
				border-radius: 5px;
				background-color: rgba(274, 90, 87, 0.2);

				.auto-title {
					// background-color: #AD4440;
					margin-right: 20rpx;
					// padding: 10rpx 20rpx;
					// color: #F64444;
					// color: #FFFFFF;
					font-size: 30rpx;
					font-family: PingFang_Bold;
					// font-weight: 600;
					// border-radius: 5px;
				}
			}

			.auto-button {
				background-color: #F64444;
				color: #FFFFFF;
				padding: 10rpx 20rpx;
				border-radius: 5px;
				font-size: 24rpx;
			}

			.auto-buy {
				background-color: #F64444;
				border-radius: 5px;

				.button {
					color: #FFFFFF;
					padding: 10rpx 20rpx;
					font-size: 28rpx;
				}
			}
		}

		.auto-background {
			// height: 62vh;
			padding-bottom: 40rpx;

			.auto-title {
				margin: 40rpx 0;
				text-align: center;
				font-size: 34rpx;
				// font-weight: 600;
				font-family: PingFang_Bold;
			}

			.auto-manage {
				// position: relative;
				// right: 20rpx;
				text-align: center;
				margin: 0 0 0 40rpx;
				width: 26vw;
				box-sizing: border-box;
				background-color: #F64444;
				border-radius: 5px;
				// box-shadow: 0px 2px 5px #dedede;

				.button-style {
					padding: 10rpx 14rpx;
					color: #FFFFFF;
					font-size: 24rpx;
					// cursor: pointer;
				}
			}

			.button-group {
				background-color: #FFFFFF;
				padding: 0 15px;
				// margin: 18px 3px;
				// box-shadow: 0px 2px 5px #dedede;

				.content {

					.null-text {
						margin: 30rpx 0;
						text-align: center;
						color: #686868;
					}

					.button {
						padding: 30rpx 0 30rpx 15rpx;
						box-sizing: border-box;
						display: flex;
						align-items: center;
						justify-content: space-between;

						.left {
							display: flex;
							align-items: center;

							.content-text {


								.date-title {
									font-size: 17px;
									// font-weight: 600;
									font-family: PingFang_Bold;
								}

								.date-tips {
									margin-top: 10rpx;
									color: #686868;
									font-size: 13px;
								}
							}
						}

						.right {

							.in {
								width: 3.7vw;
								height: 3.7vw;
							}
						}
					}
				}
			}

			.tips-content {
				margin: 40rpx 0;
				padding: 0 15px;
				color: #F64444;
				font-size: 26rpx;

				.tips {
					// margin-bottom: 10rpx;
					line-height: 42rpx;
				}
			}

			.confirm-button {
				background-color: #FCEBD9;
				margin: 40px 15px 0 15px;
				padding: 24rpx 0;
				text-align: center;
				font-size: 30rpx;
				border-radius: 5px;
				// cursor: pointer;
			}
		}
	}
</style>
